﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/DigitalTV.Master" CodeBehind="ManterPacote.aspx.cs" Inherits="WebApplication1._Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="Principal" style="width:400px">
       <div id="Consulta" style="width:400px">
       
       
           Descrição do Pacote:&nbsp;
           <asp:TextBox ID="tbPacote" runat="server" Width="245px"></asp:TextBox>
&nbsp;
           <asp:Button ID="btPesquisar" runat="server" Text="Pesquisar Pacotes" 
               onclick="btPesquisar_Click" />
           <br />
           <br />
           <asp:GridView ID="gvPacote" runat="server" AllowPaging="True" 
               AutoGenerateColumns="False" BackColor="White" BorderColor="#DEDFDE" 
               BorderStyle="None" BorderWidth="1px" CellPadding="4" DataSourceID="odsPacote" 
               ForeColor="Black" GridLines="Vertical" Width="439px">
               <FooterStyle BackColor="#CCCC99" />
               <RowStyle BackColor="#F7F7DE" />
               <Columns>
                   <asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" />
                   <asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" />
                   <asp:BoundField DataField="Valor" HeaderText="Valor" SortExpression="Valor" />
                   <asp:BoundField DataField="Data" HeaderText="Data" SortExpression="Data" />
                   <asp:TemplateField HeaderText="Atualizar">
                       <ItemTemplate>
                           <asp:LinkButton ID="lbAtualizar" runat="server" onclick="lbAtualizar_Click">Atualizar</asp:LinkButton>
                       </ItemTemplate>
                   </asp:TemplateField>
                   <asp:TemplateField HeaderText="Remover">
                       <ItemTemplate>
                           <asp:LinkButton ID="lbRemover" runat="server" onclick="lbRemover_Click">Remover</asp:LinkButton>
                       </ItemTemplate>
                   </asp:TemplateField>
               </Columns>
               <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
               <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
               <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
               <AlternatingRowStyle BackColor="White" />
           </asp:GridView>
           <asp:ObjectDataSource ID="odsPacote" runat="server" 
               DataObjectTypeName="Negocios.PacoteBO" DeleteMethod="Excluir" 
               InsertMethod="Inserir" OldValuesParameterFormatString="original_{0}" 
               SelectMethod="Consultar" TypeName="Negocios.PacoteBoMetodos" 
               UpdateMethod="Alterar">
               <SelectParameters>
                   <asp:ControlParameter ControlID="tbPacote" Name="nome" PropertyName="Text" 
                       Type="String" />
               </SelectParameters>
           </asp:ObjectDataSource>
           <br />
           <asp:Button ID="btCadastrar" runat="server" Text="Cadastrar Novo Pacote" 
               onclick="btCadastrar_Click" />
           <br />
           <br />
       
       
       </div>
       <div id="Cadastro" style="width:400px" class="divDados">
       
       
           <table class="style1">
               <tr>
                   <td class="style2">
                       Id</td>
                   <td>
                       <asp:TextBox ID="tbID" runat="server" Width="41px"></asp:TextBox>
                   </td>
               </tr>
               <tr>
                   <td>
                       Nome</td>
                        <td>
                            <asp:TextBox ID="tbNome" runat="server" Width="370px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Data</td>
                        <td>
                            <asp:TextBox ID="tbData" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Valor R$</td>
                        <td>
                            <asp:TextBox ID="tbValor" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                </table>
                <div id="Cadastro2" style="width:400px" class="divDados">
                
                
                    <br />
                
                
                    <br />
                    <asp:DropDownList ID="ddCanal" runat="server" AutoPostBack="True" 
                        Width="150px" DataSourceID="odsCanal" DataTextField="Nome" 
                        DataValueField="Id">
                        <asp:ListItem>Canal</asp:ListItem>
                    </asp:DropDownList>
                    <asp:ObjectDataSource ID="odsCanal" runat="server" 
                        DataObjectTypeName="Negocios.CanalBO" DeleteMethod="Excluir" 
                        InsertMethod="Insere" OldValuesParameterFormatString="original_{0}" 
                        SelectMethod="Consultar" TypeName="Negocios.CanalBOMetodos" 
                        UpdateMethod="Atualizar">
                        <SelectParameters>
                            <asp:Parameter Name="nome" Type="String" />
                            <asp:Parameter Name="descrição" Type="Int32" />
                            <asp:Parameter Name="tematica" Type="String" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
&nbsp;
                    <asp:Button ID="btIncluirCanal" runat="server" Text="Incluir" Width="50px" 
                        onclick="btIncluirCanal_Click" />
                    <br />
           <asp:GridView ID="gvCanal" runat="server" BackColor="#DEBA84" 
               BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="2" 
               CellSpacing="2" onselectedindexchanged="GridView1_SelectedIndexChanged" 
                        AutoGenerateColumns="False" Height="54px" Width="265px">
               <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
               <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
               <Columns>
                   <asp:ButtonField ButtonType="Button" Text="Excluir" />
                   <asp:BoundField HeaderText="ID" />
                   <asp:BoundField HeaderText="Canal" />
                   <asp:BoundField HeaderText="Data" />
               </Columns>
               <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
               <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
               <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
           </asp:GridView>
                    <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:Button ID="btSalva" runat="server" onclick="btSalva_Click" Text="Salvar" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:Button ID="btCancela" runat="server" Text="Cancelar" 
                        onclick="btCancela_Click" />
                    <br />
               </div>
    </div>
    </div>
    </asp:Content>